@extends('admin::layouts.master')
@section('title')
    商家服务协议列表
@endsection
@section('tab')
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">


                    <div class="layui-card-body">
                        <button class="layui-btn layui-btn-normal" onclick="xadmin.open('添加商家服务协议','{{route("admin_platform_business_agreement_create")}}',800,600)"><i class="layui-icon"></i>添加</button>

                    </div>
                    <div class="layui-card-body layui_overflow_y">

                        <table class="layui-table layui-form">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>ID</th>
                                <th>标题</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($data as $key=>$value)
                                <tr>
                                    <td>{{$key+1}}</td>
                                    <td>{{$value["id"]}}</td>
                                    <td>{{$value["title"]}}</td>

                                    <td class="td-manage">
                                        <button class="layui-btn layui-btn layui-btn-xs"  onclick="xadmin.open('修改商家服务协议','{{route("admin_platform_business_agreement_edit",["id"=>$value["id"]])}}')" ><i class="layui-icon">&#xe642;</i>修改</button>
                                        <button class="layui-btn-danger layui-btn layui-btn-xs ajax_member_del" data-href="{{route('admin_platform_business_agreement_delete',['id'=>$value['id']])}}" data-title="确定删除商家服务协议吗？请谨慎操作" href="javascript:;" ><i class="layui-icon">&#xe640;</i>删除</button>
                                    </td>
                                </tr>

                            @endforeach
                            @if($page_data['total'] == 0)
                                <tr><td colspan="66" style="text-align: center">暂无数据</td></tr>
                            @endif
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-card-body ">
                        <div class="page">
                            {{$page_link}}
                        </div>
                        <div id="page"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('tab_js')
    <script>
        layui.use(['form'], function () {
            var form = layui.form;

            //监听指定开关-修改状态
            form.on('switch(change_state)',
                function (obj) {
                    change_state(this);
                });

            //监听搜索
            form.on('submit(sreach)',
                function (data) {
                    var $_url = full_url('{{route('admin_platform_business_agreement_index')}}', data.field);
                    location_redirect($_url)
                });
            form.render();
        });
    </script>
@endsection




